package xcmg.device.infra.enums;
/**
 * @Des 发货通知单、发运交接单、领料单、其它出库单、其它入库单审核状态枚举
 * @Date 2021/4/11 17:28
 * @Author wangzhaoyu
 * @Param
 * @Return
 */
public enum BusinessOrderAuditStatusEnum {
    AUDIT_WAIT(1,"待审核"),
    AUDIT_PASS(2,"审核通过"),
    AUDIT_REJECT(3,"审核拒绝")        ;

    private Integer auditStatus;

    private String auditStatusDesc;

    public Integer getAuditStatus() {
        return auditStatus;
    }

    public void setAuditStatus(Integer auditStatus) {
        this.auditStatus = auditStatus;
    }

    public String getAuditStatusDesc() {
        return auditStatusDesc;
    }

    public void setAuditStatusDesc(String auditStatusDesc) {
        this.auditStatusDesc = auditStatusDesc;
    }

    BusinessOrderAuditStatusEnum(Integer auditStatus, String auditStatusDesc) {
        this.auditStatus = auditStatus;
        this.auditStatusDesc = auditStatusDesc;
    }

    /** 判断审核状态是否合法，合法则返回true,否则返回false
     * @Des
     * @Date 2021/4/12 14:00
     * @Author wangzhaoyu
     * @Param [auditStatus]
     * @Return boolean
     */
    public static boolean auditStatusLegal(Integer auditStatus){
        if(auditStatus == null){
            return false;
        }
        for(BusinessOrderAuditStatusEnum statusEnum : BusinessOrderAuditStatusEnum.values()){
            Integer currentStatus = statusEnum.getAuditStatus();
            if(currentStatus.compareTo(auditStatus) == 0){
                return true;
            }
        }
        return false;
    }
}
